﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BloodApp.Common
{
    public class ChangeLanguageService
    {
        public delegate void ChangeLanguageDelegate(string language);
        public delegate string LoadLanguageDelegate(string key);
        public event LoadLanguageDelegate? OnLoadLanguage;
        public event ChangeLanguageDelegate? OnChangeLanguage;
        //发布切换语言
        public void ChangeLanguagePublish(string language)
        {
            OnChangeLanguage?.Invoke(language);
        }
        public string? GetValueByKey(string key)
        {
            return OnLoadLanguage?.Invoke(key);
        }
    }
}
